package com.yi.mall.common.model.search;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document( indexName = "skues", createIndex = true)
public class SkuEs {
    @Id
    @Field( type = FieldType.Long)
    private Long id;
    @Field ( name = "spu_id", type = FieldType.Long)
    private Long spuId;
    @Field ( type = FieldType.Long)
    private Long price;
    @Field( name = "sku_name", type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String skuName;
    @Field( name = "sku_attribute" ,type = FieldType.Text)
    private String skuAttribute;
    @Field( type = FieldType.Integer)
    private Integer num;
    @Field( name = "brand_id" ,type = FieldType.Long)
    private Long brandId;
    @Field( name = "brand_name" ,type = FieldType.Keyword)
    private String brandName;
    @Field( name = "category_id" ,type = FieldType.Long)
    private Long categoryId;
    @Field( name = "category_name" ,type = FieldType.Keyword)
    private String categoryName;
    @Field( name = "sku_default_img" ,type = FieldType.Keyword)
    private String skuDefaultImg;
    @Field( type = FieldType.Keyword)
    private String images;
    @Field( type = FieldType.Integer)
    private Integer status;
    @Field( name = "create_time" ,type = FieldType.Date)
    private Date createTime;
    @Field( name = "update_time" ,type = FieldType.Date)
    private Date updateTime;
}